package me.zhengjie.minbearwcs.serivce.shifting;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.minbearwcs.entity.DTO.transfer.Tuple;
import me.zhengjie.minbearwcs.serivce.mission.generate.MissionGeneratorCollector;
import me.zhengjie.minbearwcs.serivce.mission.generate.type.MissionGenType;
import me.zhengjie.minbearwcs.serivce.mission.locker.StorageLockCollector;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class ShiftingService {

    private final MissionGeneratorCollector missionGeneratorCollector;

    public Tuple<String> receiveShiftingMission(String pallet){
        Tuple generate = Tuple.tuple("",false);
        synchronized (StorageLockCollector.lockStorage5FOr6F){
            generate = missionGeneratorCollector.getGenerator(MissionGenType.SHIFTING).generate(pallet);
        }
        return generate;
    }


}
